package org.blog.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.blog.common.ResultVO;
import org.blog.service.FileService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * 文件上传相关接口
 * 文件上传，下载等相关操作统一写在此类中
 */
@Slf4j
@RestController
@Api("文件操作模块")
@RequestMapping("/api/file")
public class FileController {
    @Resource
    private FileService fileService;

    @ApiOperation("文件上传")
    @PostMapping("/upload")
    public ResultVO upload(MultipartFile file) {
        // TODO hemj 需要上传到oss服务中
        return ResultVO.success("fileId");
    }
}
